﻿namespace Service.Core.Result
{
    /// <summary>
    ///     通用处理结果
    /// </summary>
    public class NativeResult : ServiceResult
    {
        public NativeResult()
        {
            Code = ResultType.Error;
        }

        public override object GetCode()
        {
            return ReCode;
        }

        public override void SetCode(object lgCode)
        {
            Code = (ResultType) lgCode;
        }

        public override object GetData()
        {
            return ReData;
        }

        public override void SetData(object lgdata)
        {
            Data = lgdata;
        }

        public override void SetMsg(string msg)
        {
            Msg = msg;
        }

        #region Serialize方便序列化

        /// <summary>
        ///     方便序列化
        /// </summary>
        public object ReCode => Code;

        /// <summary>
        ///     方便序列化
        /// </summary>
        public object ReData => Data;

        /// <summary>
        ///     方便序列化
        /// </summary>
        public object ReMsg => GetMsg();

        #endregion
    }
}